﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Goat.Controls.TreeView.Demo
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();

            treeView1.Root = new FolderNode("c:\\");
            //treeView1.ShowRoot = false;
            //treeView1.SelectionChanged += new SelectionChangedEventHandler(treeView1_SelectionChanged);

            treeView2.Root = new FolderNode("c:\\");

            treeView3.Root = new FolderNode("c:\\");
            //treeView2.ShowRootExpander = true;
            //treeView2.ShowRoot = false;
        }

        public static string LoadIcon(string name)
        {
            var result = BitmapFrame.Create(new Uri("pack://application:,,,/Images/" + name, UriKind.Absolute));
            return result.ToString();

            //return "";
        }

        private void Edit_Click(object sender, RoutedEventArgs e)
        {
            var item = treeView1.SelectedItem as FileSystemNode;
            item.IsEditing = true;
        }
    }
}
